package com.example.news_demo.service;

import com.example.news_demo.entity.User;
import com.example.news_demo.entity.View;
import com.example.news_demo.entity.ViewLog;
import com.example.news_demo.mapper.ViewLogMapper;
import com.example.news_demo.mapper.ViewMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ViewService {

    @Autowired
    private ViewMapper viewMapper;


    public void insertView(View view){
        viewMapper.insertView(view);
    }

    public List<View> getAllByUserId(int userId){
        return viewMapper.getAllByUserId(userId);
    }

}
